<%@ taglib uri="struts-html" prefix="html" %>
<%@ taglib uri="struts-logic" prefix="logic" %>
<%@ taglib uri="struts-bean" prefix="bean" %>
<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<jsp:include page="../common/top.jsp"/>

<p>
<br>

	<!--Paging-->
	<c:set var="currentAction" scope="session" value="/struts/dashboard/dashboardAction.do"/>
	<c:set var="nextMethod" scope="session" value="searchNextCurrentTransactions"/>
	<c:set var="previousMethod" scope="session" value="searchPreviousCurrentTransactions"/>
	<jsp:include page="../common/paging.jsp"/>
	
	<table class="searchTable" border="0" width="100%">
	<thead>
	<tr>
	<th class="false" align="left">Tx Id</th>
	<th class="false" align="left">Tx Date</th>
	<th class="false" align="left">Tx Amount</th>
	<th class="false" align="left">Registrant First Name</th>
	<th class="false" align="left">Registrant Last Name</th>
	<th class="false" align="left">Registered By</th>
	
	</tr></thead>
	<tbody>
	
	<c:set var ="id" value="0"/>
	<c:set var ="total" value="0"/>
	<c:set var ="cumulTotal" value="0"/>
	<c:forEach var="tx" items="${txListing}" varStatus="loop">
	
		<c:choose>
	     <c:when test='${(status.index)%2 eq 0}'>
	      <c:set var="rowColor" value="even" scope="page"/>
	    </c:when>
	    <c:otherwise>
	      <c:set var="rowColor" value="odd" scope="page"/>
	    </c:otherwise>
	  </c:choose>
	
	
		<c:if test="${id!=tx.conventionExecutive.executiveId && id!=0}">
	   		<tr><td align="right" colspan="6"><b>Total: ${total}</b></td></tr>
	   		<c:set var ="cumulTotal" value="${cumulTotal+total}"/>
	   		<c:set var ="total" value="0"/>
	   		
	   </c:if>
			
		<tr class="${((loop.index % 2) == 1) ? 'even' : 'odd'}">
			<td align="left">${tx.transactionId}</td>
	   		<td align="left">${tx.transactionDate}</td>
	   		<td align="left">${tx.transactionAmount}</td>
	   		<td align="left">${tx.registrant.firstName}</td>
	   		<td align="left">${tx.registrant.lastName}</td>
	   		<td align="left">${tx.conventionExecutive.firstName}</td>
	   	
	    </tr>
	    
	    
	   
	   
		
		<c:set var ="total" value="${total+tx.transactionAmount}"/>
	   
		<c:set var ="id" value="${tx.conventionExecutive.executiveId}"/>
	</c:forEach>
	
	<tr><td align="right" colspan="6"><b>Total: ${total}</b></td></tr>
	<c:set var ="cumulTotal" value="${cumulTotal+total}"/>
	
	<tr><td align="right" colspan="6"><b>Full Total: ${cumulTotal}</b></td></tr>
	
	
	</tbody>
	<table>
	<!--Paging-->
	<jsp:include page="../common/paging.jsp"/>
	<p class="displayValue">
	Click <html:link page="/struts/dashboard/dashboardAction.do?methodToCall=loadDash">here</html:link> to return to dashboard.
	</p>

<jsp:include page="../common/bottom.jsp" />